package cn.jh.common.utils;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.math.BigDecimal;


/**
 * @author Fuchun
 * @since 1.0
 */
public abstract class MathKt {

    public static int add(Integer source, int augend) {
        int addend = source == null ? 0 : source;
        return addend + augend;
    }

    public static BigDecimal add(@Nullable BigDecimal source, @NotNull BigDecimal augend) {
        BigDecimal addend = source == null ? BigDecimal.ZERO : source;
        return addend.add(augend);
    }

    private MathKt() {}
}
